<!--
 * @description  : 外流零售户提醒
 * @descriptionDetail: 外流零售户提醒
 * @copyright    : 浙江烟草
 * @author       : mwq
 * @create       : 2022-09-27 09:58:58
-->

<template>
  <view>
    <!-- #ifdef H5-ONLY -->
    <theme-navbar
      :is-white="false"
      :title="navTitle"
      :custom-back="goBack"
      style="z-index: 99999"
    >
    <!-- #endif -->
    </theme-navbar>
    <view v-if="showTip==true" class="no-data">
      ~暂无数据~
    </view>
    <view>
      <view>
        <u-card
          v-for="(item,index) in regularList"
          margin="0"
          :border="false"
          :show-foot="false"
          :show-head="false"
          :key="index"
          border-radius="0rpx"
          :full="false"
          class="card"
        >
          <template #body>
            <u-row gutter="12">
              <u-col span="1.5">
                <view style="width:40px;height:40px;border-radius:25px;background-color:#ecebeb;">
                  <view style="text-align:center;padding-top:10px;font-weight:bold;">
                    {{ index +1 }}
                  </view>
                </view>
              </u-col>
              <u-col style="font-size:24px;font-weight:bold;" span="8.5">
                {{ item.brandName }}
              </u-col>
            </u-row>
            <u-line class="u-line" color="#999" margin="20rpx"></u-line>
            <u-row gutter="12">
              <u-col style="font-size:20px;margin-bottom:8px;" span="12">
                {{ item.brandCode }}
              </u-col>
              <u-col style="color:#999;margin-bottom:8px;" span="4">
                触发建议规则
              </u-col>
              <u-col style="font-size:16px;margin-bottom:8px;" span="12">
                {{ item.temp2 }}
              </u-col>
              <u-col style="color:#999;margin-bottom:8px;" span="16">
                外流规格
              </u-col>
              <u-col style="font-size:16px;margin-bottom:8px;" span="12">
                <u-read-more
                  :show-height="50"
                  :shadow-style="shadowStyle" 
                  :toggle="true"
                  close-text="展示"
                  open-text="关闭"
                  style="padding-left:5px"
                >
                  <rich-text :nodes="item.temp4">
                    {{ item.temp4 }}
                  </rich-text>
                </u-read-more>
              </u-col>
            </u-row>
          </template>
        </u-card>
      </view>
    </view>
  </view>
</template>
<script>
import approval from "@/service/internal/approval.service.js";
export default {
  components:{},
  onLoad(opt) {
    this.parse = opt;
    this.title = opt.title;
  },
  data(){
    return{
      formData: {
        dCodeName:'',
        text:'',
      },
      labelWidth: 200, 
      shadowStyle: {
        backgroundImage: "none",
        paddingTop: "0",
      },
      regularList:[], 
      parse:{},
      showTip:false,
    }
  },
  created(){
    this.loadData();
  },
  methods:{
    loadData(){
      let params = {
        reportId:this.parse.regularReportUuid,
        targetLevel:this.parse.targetLevel,
      }
      return approval.regularReportList(params).then((d) => {
        if(d.data.length == 0){ this.showTip = true }else{ this.showTip = false }
        this.regularList = d.data;
      });
    },
  },
}
</script>
<style lang="scss" scoped>
	.card{
         border-width: 10px;
         border-color:#ecebeb;
         border-bottom-style: solid;
  }
  .button{
  position: fixed;
  bottom: 0px;
  width:100%;
}
.no-data{
  text-align:center;
  margin:20px;
}
</style>